package com.woniuxy.repayment.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.woniuxy.commons.vo.ProjectVo;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
public class Repayment {
    private Integer id;
    private String pno;
    private Integer uid;
    private String pname;
    private Integer num;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime Interesttime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime predictmoney;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime actualmoney;
    private BigDecimal paidmoney;
    private BigDecimal repaymentmoney;
    private BigDecimal principalreceivable;
    private BigDecimal interestreceivable;
    private String state;

    public void setFromProjectvo(ProjectVo projectVo){
        this.pno = projectVo.getPno();
        this.uid = projectVo.getUid();
        this.pname = projectVo.getPname();
        this.num = projectVo.getDeadline();
    }
}
